package com.xxx.yuedong.community.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.json.JSONUtil;
import com.xxx.yuedong.common.R;
import com.xxx.yuedong.common.consts.ActionConstants;
import com.xxx.yuedong.community.controller.form.DeleteAnnounceByIdForm;
import com.xxx.yuedong.community.controller.form.InsertAnnounceForm;
import com.xxx.yuedong.community.controller.form.SearchRemindByIdForm;
import com.xxx.yuedong.community.pojo.Announce;
import com.xxx.yuedong.community.service.AnnounceService;
import com.xxx.yuedong.community.service.RemindService;
import com.xxx.yuedong.utils.EventMsgSendUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @author HG
 * @version 1.0
 **/
@Api(tags = "消息相关接口")
@RestController
@RequestMapping("/remind")
public class RemindController {
    @Autowired
    private RemindService remindService;

    @PostMapping("/searchRemindById")
    @ApiOperation("根据用户ID查询消息")
    public R searchRemindById(@Valid @RequestBody SearchRemindByIdForm form) {
        List<HashMap> msgList = remindService.searchRemindById(form.getUserId());

        return R.ok().put("msgList", msgList);
    }
}
